
#include <iostream>
#include <GL/glut.h>
#include "../include/Model.h"
#include "../include/ModelPart.h"

using namespace std;

void init(int argc, char* argv[]);
void testModelPart();
void testModel();

int main(int argc, char* argv[]){
	init(argc, argv);
	//testModelPart();
	testModel();
	
	return 0;	
}

void init(int argc, char* argv[]){
	//this is all here because glGenLists doesn't work unless
	//opengl is initialized
	glutInitWindowSize(200, 200);
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
	glutCreateWindow(argv[0]);
	glEnable(GL_TEXTURE_2D);
}

void testModelPart(){
	printf("\n\n");
	printf("--:: Test_RW ::--\n");
	printf("    Model Part\n\n");
	
	ModelPart mp;
	mp.load("cluster_rt");
	int rt = mp.getModelPartId();
	printf("'%s' id: %d\n",mp.getName().c_str(),rt);
	int c1 = mp.getModelPartList()[0]->getModelPartId();
	printf("'%s' id: %d\n",mp.getModelPartList()[0]->getName().c_str(),c1);
	int c2 = mp.getModelPartList()[1]->getModelPartId();
	printf("'%s' id: %d\n",mp.getModelPartList()[1]->getName().c_str(),c2);
	
	mp.display();
	printf("it's displayed... really\n");
}//end testModelPart

void testModel(){
	printf("\n\n");
	printf("--:: Test_RW ::--\n");
	printf("      Model\n\n");

	Model m;
	m.load("dude");
	m.display();
	printf("it's displayed... really\n");
	
}//end testModel
